import VueRouter from "vue-router";
import Home from '../pages/Home.vue'
import About from '../pages/About.vue'
import News from '../pages/News.vue'
import Message from '../pages/Message.vue'
import Detail from '../pages/Detail.vue'

export default new VueRouter({
  routes: [
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: 'news',
          component: News,
          
        },
        {
          path: 'message',
          component: Message,
          children: [
            {
              path: 'detail',
              component: Detail,
              // props:{}
              // props:true
              props($route) {
                return {
                  id: $route.query.id,
		              title: $route.query.title,
                }
              }
              
            }
          ]
        },
      ]
    },
    {
      path:'/about',
      component:About
    }
  ]
})

